﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/view.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="Workflow.Common.Tools" %>
<%@ Import Namespace="Workflow.Model.Enum" %>
<%@ Import Namespace="Workflow.Resource" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
   <script>
       function report() {


           $('#form').form('submit', {
               url: '/Report/ShowPTPReport',
               success: function (data) {
                   eval('data=' + data);
                   if (data.Success) {

                   } else {
                       $.messager.alert('<%=Global.ErrorTitle%>', data.Message, 'error');

                   }

               },
               onSubmit: function () {
                   //if (_user_form.valid())
                   var DateFrom = $('#DateFrom').datebox('getValue');
                   var DateTo = $('#DateTo').datebox('getValue');
                   if (DateFrom == "" || DateTo == "") {
                       return false;
                   }
                   return true;
                  
               }
           });
       }
       $(function () {

           $('#DateFrom').datebox({
               formatter: function (date) { return date.getFullYear() + '/' + (date.getMonth() + 1) + '/' + date.getDate(); },
               parser: function (date) { return new Date(Date.parse(date.replace(/-/g, "/"))); }
           });
           $('#DateTo').datebox({
               formatter: function (date) { return date.getFullYear() + '/' + (date.getMonth() + 1) + '/' + date.getDate(); },
               parser: function (date) { return new Date(Date.parse(date.replace(/-/g, "/"))); }
           });
       });
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
   

<% using (Html.BeginForm("ShowPTPReport", "Report", FormMethod.Post,
                          new { name = "form", id = "form" }))
   {%>
   <div class="easyui-panel">
        <div class="panel-header"><%=Global.PTPReport%></div>
        <div class="panel-body"><%=Global.dateFrom%> :
            <input class="easyui-datebox" id="DateFrom"  name="DateFrom"  style="width: 100px" value="<%=ToolsHelper.GetTimeZoneNow().ToString("yyyy/MM/dd") %>">
            <%=Global.dateTo%>:
            <input class="easyui-datebox" id="DateTo" name="DateTo"  style="width: 100px" value="<%=ToolsHelper.GetTimeZoneNow().ToString("yyyy/MM/dd") %>">
            <select class="easyui-combo" id="ReportType" name="ReportType">
             <%
                    int groupCode = (int)ViewData["GroupCode"];
                    if (groupCode == (int)EnumGroup.GPAHPTP
                        || groupCode == (int)EnumGroup.GPAHEEM
                        || groupCode == (int)EnumGroup.GPPTP
                        || groupCode == (int)EnumGroup.GPEEM
                        || groupCode == (int)EnumGroup.GPMDM)
                    {
                %>
                <option value="1">伝票タイプ別件数－日</option>
                <option value="2">伝票タイプ別件数－月</option>
                <option value="3">担当者別月件数</option>
                <option value="4">First Pass Yeild</option>
                <option value="5">理由別件数</option>
                <% 
                    }
                    if (groupCode == (int)EnumGroup.MSDAHPTP
                        || groupCode == (int)EnumGroup.MSDAHEEM
                        || groupCode == (int)EnumGroup.MSDPTP
                        || groupCode == (int)EnumGroup.MSDEEM
                        || groupCode == (int)EnumGroup.MSDMDM)
                    {
                %>
                <option value="1">伝票タイプ別件数－日</option>
                <option value="2">伝票タイプ別件数－月</option>
                <option value="4">First Pass Yeild</option>
                <option value="5">理由別件数</option>

                <%  
                    }
                %>
               
            </select>
             
            <a href="#" class="easyui-linkbutton" iconcls="icon-redo" plain="true" onclick="report();"><%=Global.Export%></a></div>

    </div>
    <%
   }%>
</asp:Content>
